package com.itljm.cxrMarket.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 文章信息表
 * @TableName articles
 */
@TableName(value ="articles")
@Data
public class Articles implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer articleId;

    private String title;
    private String content;
    private String coverImageUrls;
    private Integer authorId;
    private Integer categoryId;
    private Integer productId;// 商品ID，外键引用 products 表，用于关联特定商品
    private Integer viewCount;
    private Integer commentCount;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @TableField(exist = false)
    private String authorName; // 作者名称
    @TableField(exist = false)
    private String categoryName; // 分类名称

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}